//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "logging.h"
#include "Settings.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormLog *FormLog;
//---------------------------------------------------------------------------
__fastcall TFormLog::TFormLog(TComponent* Owner)
    : TForm(Owner)
{
FormLog->MemoLog->Clear();
ToDebug("--- Start server ---",0);
FormLog->LevelLog = FormSettings->RadioGroupLog->ItemIndex;
}
//---------------------------------------------------------------------------
void __fastcall TFormLog::Button1Click(TObject *Sender)
{
 MemoLog->Lines->SaveToFile("web.log");
}

//----------TODEBUG

void __fastcall TFormLog::ToDebug(AnsiString s)
{
ToDebug(s,2);
}
void __fastcall TFormLog::ToDebug(AnsiString s,int loglvl=2)
{
if(LevelLog>=loglvl)
FormLog->MemoLog->Lines->Add(DateTimeToStr(Now())+" - " +s);
}
